<div ng-controller="z-approvalRule-c" z-loading is-loading="viewModel.isLoading">
    <div viewstack class="carousel slide" data-ride="carousel">
        <div class="carousel-inner" role="listbox">
            <div class="item active">
                <div class="row">
                    <div class="col-lg-12 heading">
                        <ul id="crumb" class="breadcrumb">
                            <li>
                                <i class="im-home"></i>
                                <a href="index.html">首页</a>
                            </li>
                            <li ng-repeat="menu in viewModel.menuList">
                                <i class="{{menu.icons}}" ng-if="$index+1!=viewModel.menuList.length"></i>
                                <i class="en-arrow-right7" ng-if="$index+1==viewModel.menuList.length"></i>
                                {{menu.label}}
                            </li>
                        </ul>
                    </div>
                </div>


                <section ng-init="viewModel.tab=1">
                    <ul class="s-tabs">
                        <li ng-class="{active:viewModel.tab===1}">
                            <a href ng-click="viewModel.changeTab(1);">审批流程设置</a>
                        </li>
                        <li ng-class="{active:viewModel.tab===2}">
                            <a href ng-click="viewModel.changeTab(2);">工资审批设置</a>
                        </li>
                    </ul>
                    <div style="width: 100%; height: 10px;"></div>
                    <div class="panel" ng-show="viewModel.tab==1">
                        <div class="outlet">
                            <div class="panel-body">
                                <form class="form-horizontal group-border hover-stripped" role="form" name="form">
                                    <div class="row">
                                        <div class="col-xs-12 col-sm-10 col-md-11 form-box">
                                            <div class="col-sm-6 col-md-4 col-lg-3 form-item">
                                                <div class="col-sm-5 col-md-5 form-title">审批类型：</div>
                                                <div class="col-sm-7 col-md-7 form-input">
                                                    <select id="attendanceState" class="form-control" ng-model="viewModel.requestType" tabIndex="2">
                                                        <option value=""></option>
                                                        <option ng-repeat="dictionary in viewModel.requestTypeData" value="{{dictionary.dicCd}}" ng-if="dictionary.dicCd!=10">{{dictionary.dicName}}</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-sm-6 col-md-4 col-lg-3 form-item">
                                                <div class="col-sm-5 col-md-5 form-title">申请岗位级别：</div>
                                                <div class="col-sm-7 col-md-7 form-input">
                                                    <select id="attendanceState" class="form-control" ng-model="viewModel.requestRole" tabIndex="3">
                                                        <option value=""></option>
                                                        <option ng-repeat="dictionary in viewModel.requestRoleData" ng-if="dictionary.dicCd!=99" value="{{dictionary.dicCd}}">{{dictionary.dicName}}</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="col-sm-3 col-md-4 col-lg-3 form-item">
                                                <div class="col-lg-1 col-md-1">
                                                    <button type="button" class="btn btn-success" ng-click="viewModel.rowCount=1;viewModel.bindData();" tabIndex="4">搜索</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                        <div class="outlet outbon">
                            <button class="btn btn-success" ng-click="viewModel.add()" tabIndex="1">新增</button>
                        </div>
                        <div class="container-fluid">
                            <div class="row">
                                <!-- <table class="table table-striped  table-bordered table-hover"> -->
                                <table class="table table-striped table-bordered" cellspacing="0" width="100%">
                                    <thead>
                                    <tr>
                                        <th>审批类型</th>
                                        <th>申请岗位级别</th>
                                        <th width="6%">起始天数</th>
                                        <th width="6%">终止天数</th>
                                        <th>最低审批级别</th>
                                        <th>一级审批</th>
                                        <th>二级审批</th>
                                        <th>三级审批</th>
                                        <th>四级审批</th>
                                        <th>五级审批</th>
                                        <th width="14%">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="approvalRule in viewModel.dataList">
                                        <td>{{approvalRule.requestTypeName}}</td>
                                        <td>{{approvalRule.requestRoleName}}</td>
                                        <td>{{approvalRule.fromDays}}</td>
                                        <td>{{approvalRule.toDays}}</td>
                                        <td>{{approvalRule.lowestApprovalRoleName}}</td>
                                        <td>{{approvalRule.oneApprovalRoleName}}</td>
                                        <td>{{approvalRule.twoApprovalRoleName}}</td>
                                        <td>{{approvalRule.threeApprovalRoleName}}</td>
                                        <td>{{approvalRule.fourApprovalRoleName}}</td>
                                        <td>{{approvalRule.fiveApprovalRoleName}}</td>
                                        <td>
                                            <button type="button"
                                                    class="btn btn-primary btn-sm"
                                                    ng-click="viewModel.update(approvalRule)">修改</button>
                                            <button type="button"
                                                    class="btn btn-danger btn-sm"
                                                    ng-click="viewModel.del(approvalRule)">删除</button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="row">
                                <div z-Pagination total-Data='viewModel.totalData'
                                     per-Page='viewModel.perPage'
                                     current-Page='viewModel.rowCount'
                                     on-Click="viewModel.bindData()"
                                     on-Change-Per-Page="viewModel.bindData()"></div>
                            </div>
                        </div>
                    </div>
                    <div class="panel" ng-show="viewModel.tab==2">
                        <div class="outlet outbon">
                            <div class="row">
                                <div class="col-lg-12">
                                    <div class="col-lg-10">
                                        <button class="btn btn-success" ng-click="viewModel.tab2add()" tabIndex="1">新增</button>
                                    </div>
                                 <!--    <div class="col-lg-1">
                                        <button class="btn btn-success" ng-click="viewModel.tab2bindData()" tabIndex="1">搜索</button>
                                    </div> -->
                                </div>
                            </div>
                        </div>
                        <div class="container-fluid">
                            <div class="row">
                                <table class="table table-striped table-bordered" cellspacing="0" width="100%">
                                    <thead>
                                    <tr>
                                        <th>一级审批</th>
                                        <th>二级审批</th>
                                        <th>三级审批</th>
                                        <th>四级审批</th>
                                        <th>五级审批</th>
                                        <th width="14%">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr ng-repeat="rule in viewModel.dataList2">
                                        <td>{{rule.oneEmployeeName}}<span ng-if="rule.oneEmployeeNo!=null">({{rule.oneEmployeeNo}})</span></td>
                                        <td>{{rule.twoEmployeeName}}<span ng-if="rule.twoEmployeeNo!=null">({{rule.twoEmployeeNo}})</span></td>
                                        <td>{{rule.threeEmployeeName}}<span ng-if="rule.threeEmployeeNo!=null">({{rule.threeEmployeeNo}})</span></td>
                                        <td>{{rule.fourEmployeeName}}<span ng-if="rule.fourEmployeeNo!=null">({{rule.fourEmployeeNo}})</span></td>
                                        <td>{{rule.fiveEmployeeName}}<span ng-if="rule.fiveEmployeeNo!=null">({{rule.fiveEmployeeNo}})</span></td>
                                        <td>
                                            <button type="button"
                                                    class="btn btn-primary btn-sm"
                                                    ng-click="viewModel.tab2update(rule)">修改</button>
                                            <button type="button"
                                                    class="btn btn-danger btn-sm"
                                                    ng-click="viewModel.tab2del(rule)">删除</button>
                                        </td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                            <div class="row" style="display: none;">
                                <div z-Pagination total-Data='viewModel.tab2totalData'
                                     per-Page='viewModel.tab2perPage'
                                     current-Page='viewModel.tab2rowCount'
                                     on-Click="viewModel.tab2bindData()"
                                     on-Change-Per-Page="viewModel.tab2bindData()"></div>
                            </div>
                        </div>

                    </div>

                </section>
            </div>
        </div>
    </div>
    <z-Dialog show-Save-Btn="true"
              have-Error-Class="false"
              load-Url="static/html/approvalRule/approvalRuleEdit.html"
              title="{{editModel.title}}"
              show="viewModel.show"
              cancel-fn="viewModel.unLoad()"
              save-fn="viewModel.save()"
              body-Height="425"></z-Dialog>

    <z-Dialog show-Save-Btn="true"
              have-Error-Class="false"
              load-Url="static/html/approvalRule/salaryApprovalRuleEdit.html"
              title="{{editModel2.title}}"
              show="viewModel.show2"
              cancel-fn="viewModel.tab2unLoad()"
              save-fn="viewModel.tab2save()"
              body-Height="425"></z-Dialog>
    <z-Dialog show-Save-Btn="false"
              have-Error-Class="false"
              load-Url="static/html/approvalRule/selectEmployee.html"
              title="{{viewEmployeeModel.title}}"
              show="viewEmployeeModel.show"
              save-fn="viewEmployeeModel.saveEmployee()"
              cancel-fn="viewEmployeeModel.unLoad()"></z-Dialog>
</div>